package cn.iocoder.yudao.module.system.dal.mysql.appupgradeinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.dal.dataobject.appupgradeinfo.AppUpgradeInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.system.controller.admin.appupgradeinfo.vo.*;

/**
 * app升级信息 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface AppUpgradeInfoMapper extends BaseMapperX<AppUpgradeInfoDO> {

    default PageResult<AppUpgradeInfoDO> selectPage(AppUpgradeInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppUpgradeInfoDO>()
                .likeIfPresent(AppUpgradeInfoDO::getVersionName, reqVO.getVersionName())
                .eqIfPresent(AppUpgradeInfoDO::getVersionCode, reqVO.getVersionCode())
                .eqIfPresent(AppUpgradeInfoDO::getUpdateLog, reqVO.getUpdateLog())
                .eqIfPresent(AppUpgradeInfoDO::getDownloadUrl, reqVO.getDownloadUrl())
                .betweenIfPresent(AppUpgradeInfoDO::getForceUpdate, reqVO.getForceUpdate())
                .betweenIfPresent(AppUpgradeInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppUpgradeInfoDO::getId));
    }

}